Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Make sure RepeatTeacher doesn't leak files. #1225

Merged
merged 1 commit into from
Oct 17, 2018
Merged

Conversation

stephenroller
Copy link
Contributor

Right now, running the unittest suite results in a leaking file unused_paths.lengths. This behavior derives from:

task='tasks.repeat:RepeatTeacher:10',

class RepeatTeacher(DialogTeacher):
def __init__(self, opt, shared=None):
opt = copy.deepcopy(opt)
opt['datafile'] = 'unused_path'
task = opt.get('task', 'tests.tasks.repeat:RepeatTeacher:50')
self.data_length = int(task.split(':')[2])
super().__init__(opt, shared)
def setup_data(self, unused_path):
for i in range(self.data_length):
yield ((str(i), [str(i)]), True)

length_file = datafiles[0] + ".lengths"

@stephenroller stephenroller merged commit 9441144 into master Oct 17, 2018
@stephenroller stephenroller deleted the quietrepeat branch October 17, 2018 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants